powered by
colmeans(x) rowmeans(x)
colsums, rowsums, colMins, colMedians, colMads
x <- matrix(rpois(1000 * 1000,10),ncol = 1000) x1 <- colmeans(x) x2 <- colMeans(x) all.equal(x1,x2) x1 <- rowmeans(x) x2 <- rowMeans(x) all.equal(x1,x2)
Run the code above in your browser using DataLab